﻿using DC2010.Objects.Data;
using DC2010.Objects.Base;
using DC2010.Objects;

namespace DC2010.Effects
{
    public class I_Die_Effect : EffectLogic
    {
        public I_Die_Effect(EffectData ed)
            : base(ed)
        {
            ShortName = "Die";
            LongName = "Creature will die";
            Id = "I_DIE_EFFECT";
            EffectType = EffectType.Instant;
        }

        public override void Instant(BaseObject aInvoker, BaseObject aTarget)
        {
            if (aInvoker is CreatureData)
            {
                CreatureData c = (CreatureData) aInvoker;

                c.Flags.IsDead = true;

                c.Attributes.Health.SetCurrent(0);
                c.Attributes.Stamina.SetCurrent(0);
                c.Attributes.Mana.SetCurrent(0);
            }
        }
    }
}
